/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DBFunction;

import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

public class fPOIStatus {
	public static void process(String POIJsonString) throws JSONException {
		JSONObject object = new JSONObject();
		object = (JSONObject) new JSONTokener(POIJsonString).nextValue();
		String POIid = object.getString("POIid");
		String status = object.getString("POIStatus");
		if (status.equals("hide")) {
			String sql = "UPDATE buddytracking.poi set IsHidden='1' where poi.POIId='"
					+ POIid + "'";
			DB.connectDB.Update(sql);
		} else if (status.equals("show")) {
			String sql = "UPDATE buddytracking.poi set IsHidden='0' where poi.POIId='"
					+ POIid + "'";
			DB.connectDB.Update(sql);
		}
	}
}
